using UnityEngine;

namespace BasicScript.Component
{
	public class Line : MonoBehaviour
	{
		public Transform point1;

		public Transform point2;

		private LineRenderer line;

		private void Start()
		{
			line = base.gameObject.GetComponent<LineRenderer>();
			line.startWidth = 0.04f;
			line.endWidth = 0.04f;
			line.positionCount = 2;
		}

		private void Update()
		{
			if (point1 != null && point2 != null)
			{
				line.SetPosition(0, point1.position);
				line.SetPosition(1, point2.position);
			}
		}
	}
}
